<%@ include file="connect.jsp" %>
<%--
  Created by IntelliJ IDEA.
  User: Mery
  Date: 10/25/12
  Time: 11:03 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<link href="style.css" rel="stylesheet"/>

<html>
<head>
    <title></title>
    <%-- <script type="text/javascript">
        function validasi()
        {
            var nama = document.getElementById("nama").value;

            if(nama == " " || nama == null)
            {
                err.innerHTML = "Please insert category name!";
                return false;

            }

            else
            {
                return true;
            }
        }

    </script>--%>
</head>

<body>
<div id="popup-header">
    <h2>Edit Category's Name</h2>
</div>
<form action="doEditCatName.jsp" method="post">
    <div class="txt-fld" id="word1">
        <label style="padding-top: 10px">Category Name :</label>
        <%
            String idnya = request.getParameter("id");

            ResultSet rs = stat.executeQuery("select * from CATEGORIES where categoryID = '" + idnya + "' ");

            while (rs.next()) {

        %>

        <input style="margin-top: 10px; font-family: Segoe UI; font-size: 12pt"
               type="text" name="nama" id="nama" value="<% out.print(rs.getString("categoryName"));%>"/>
        <input type="hidden" name="id" value="<% out.print(rs.getString("categoryID"));%>">
        <input type="hidden" name="cathdn" value="<% out.print(rs.getString("categoryName"));%>">
    </div>
    <%} %>
    <div id="err">

    </div>

    <div class="btn-fld">
        <button type="submit">Save</button>
    </div>

</form>


</body>
</html>